package com.zjq.service;

import com.zjq.dao.UserMapper;
import com.zjq.pojo.User;

import java.util.List;

public class UserServiceImpl implements UserService {
    private UserMapper userMapper;

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    public List<User> queryAllUser() {
        return userMapper.queryAllUser();
    }

    public List<User> queryUserByUserName(String userName) {
        return userMapper.queryUserByUserName(userName);
    }

    public List queryUserByType(int type) {
        return userMapper.queryUserByType(type);
    }

    public User queryUserById(int id) {
        System.out.println("==============="+id);
        return userMapper.queryUserById(id);
    }

    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    public int deleteUser(int id) {
        return userMapper.deleteUser(id);
    }

    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    public int updateUserType(int type) {
        return userMapper.updateUserType(type);
    }
}
